package cn.iocoder.moyun.module.curd.controller.admin;

import cn.iocoder.moyun.framework.common.pojo.CommonResult;
import cn.iocoder.moyun.framework.common.pojo.PageResult;
import cn.iocoder.moyun.module.curd.controller.admin.stringtext.vo.stringtext.StringTextPageReqVO;
import cn.iocoder.moyun.module.curd.dal.dataobject.stringtext.StringTextDO;
import cn.iocoder.moyun.module.curd.service.stringtext.StringTextService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import static cn.iocoder.moyun.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - curd框架测试类")
@RestController
@RequestMapping("/curd/stringtext")
@Validated
public class CurdTestController {

    @Autowired
    private StringTextService stringTextService;

    @GetMapping("/getStringText")
    @Operation(summary = "获取 test 信息")
    public CommonResult<String> getStringText(@Validated @ModelAttribute StringTextPageReqVO pageReqVO) {
        PageResult<StringTextDO> pageResult = stringTextService.getUserPage(pageReqVO);
        return success(pageResult + "测试controller！");
    }
}
